﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ImageProcessing
{
    internal struct Pixel : IComparable<Pixel>
    {
        public Pixel(int r,int g, int b,int a)
        {
            this.r = r;
            this.g = g;
            this.b = b;
            this.a = a;
        }
        public int a;
        public int r;
        public int g;
        public int b;
        public int CompareTo(Pixel other)
        {
            if ((r * 0.3 + g * 0.59 + b * 0.11) < (other.r * 0.3 + other.g * 0.59 + other.b * 0.11)) return -1;
            if ((r * 0.3 + g * 0.59 + b * 0.11) > (other.r * 0.3 + other.g * .59 + other.b * 0.11)) return 1;
            return 0;
        }
    }
}

